package com.hejie.videoservice.service;

import com.hejie.videoservice.dto.VideoDTO;
import com.hejie.videoservice.dto.VideoPageQueryDTO;
import com.hejie.videoservice.dto.VideoUploadRequest;
import com.hejie.videoservice.entity.Video;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;
import java.util.Map;

public interface VideoService {

    /**
     * 上传视频
     */
    VideoDTO uploadVideo(VideoUploadRequest uploadRequest);

    /**
     * 获取视频详情
     */
    VideoDTO getVideoById(Long videoId);

    /**
     * 更新视频信息
     */
    VideoDTO updateVideo(Long videoId, Map<String, Object> updateFields);

    /**
     * 删除视频
     */
    boolean deleteVideo(Long videoId);

    /**
     * 查询用户视频
     */
    Page<VideoDTO> getUserVideos(Long userId, Pageable pageable);

    /**
     * 查询分类视频
     */
    Page<VideoDTO> getCategoryVideos(Long categoryId, Pageable pageable);

    /**
     * 搜索视频
     */
    Page<VideoDTO> searchVideos(String keyword, Pageable pageable);

    /**
     * 获取热门视频
     */
    Page<VideoDTO> getHotVideos(Pageable pageable);

    /**
     * 获取最新视频
     */
    Page<VideoDTO> getLatestVideos(Pageable pageable);

    /**
     * 批量获取视频
     */
    List<VideoDTO> batchGetVideos(List<Long> ids);

    /**
     * 更新视频状态
     */
    VideoDTO updateVideoStatus(Long videoId, Video.VideoStatus status);

    /**
     * 增加视频观看次数
     */
    boolean incrementViewCount(Long videoId);

    /**
     * 更新视频点赞数
     */
    boolean updateLikeCount(Long videoId, int increment);

    /**
     * 更新视频评论数
     */
    boolean updateCommentCount(Long videoId, int increment);

    /**
     * 分页查询视频
     */
    Page<VideoDTO> queryVideos(VideoPageQueryDTO queryDTO, Pageable pageable);
}